package com.study.test;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("/hello")
public class HelloController {
    Logger logger = LoggerFactory.getLogger(HelloController.class);

    @Value("$M{name}")
    private String name;

	@RequestMapping(value = "/test",method = RequestMethod.GET)
	public String printWelcome(ModelMap model) {
        logger.info("这是{}的jndi测试",name);
        model.addAttribute("message", "Hello world!");
		return "hello";
	}
}